//
//  MCOtherPersonViewController.m
//  MicroChat
//
//  Created by Mac on 2018/5/30.
//  Copyright © 2018年 stoneobs.qq.com. All rights reserved.
//

#import "MCOtherPersonViewController.h"

@interface MCOtherPersonViewController ()

@end

@implementation MCOtherPersonViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self configSubView];
    [self confimBootomView];
    // Do any additional setup after loading the view.
}
#pragma mark --subView
- (void)configSubView{
    self.title = self.userModel.user_nick;
    
    self.tableView.backgroundColor = UIColor.whiteColor;
    UIView * header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UIScreenWidth, 10)];
    
    UIImageView * imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, UIScreenWidth, 180)];
    imageView.image = [UIImage imageNamed:@"17"];
    [header addSubview:imageView];
    
    STButton * iconButton = [[STButton alloc] initWithFrame:CGRectMake(20, imageView.bottom + 10, 60, 60)
                                                     title:nil
                                                titleColor:nil
                                                 titleFont:0
                                              cornerRadius:30
                                           backgroundColor:nil
                                           backgroundImage:nil
                                                     image:nil];
    [header addSubview:iconButton];
    [iconButton sd_setBackgroundImageWithURL:MCRealImageUrl(self.userModel.user_icon) forState:UIControlStateNormal];
    
    STLabel * nickLable = [[STLabel alloc] initWithFrame:CGRectMake(iconButton.right + 15, iconButton.top + 10, 200, 20)
                                                     text:self.userModel.user_nick
                                                textColor:FirstTextColor
                                                     font:15
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentLeft];
    [header addSubview:nickLable];
    
    STLabel * idLable = [[STLabel alloc] initWithFrame:CGRectMake(iconButton.right + 15, nickLable.bottom + 10, 200, 20)
                                                    text:self.userModel.user_name
                                               textColor:FirstTextColor
                                                    font:15
                                             isSizetoFit:NO
                                           textAlignment:NSTextAlignmentLeft];
    [header addSubview:idLable];
    
    STLabel * areadesLable = [[STLabel alloc] initWithFrame:CGRectMake(iconButton.left, iconButton.bottom + 20, UIScreenWidth - 30, 20)
                                                     text:@"地区"
                                                textColor:ThirdTextColor
                                                     font:14
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentLeft];
    [header addSubview:areadesLable];
    
    
    STLabel * areaLable = [[STLabel alloc] initWithFrame:CGRectMake(iconButton.left, iconButton.bottom + 20, UIScreenWidth - 30, 20)
                                                       text:[NSString stringWithFormat:@"%@ %@",self.userModel.province,self.userModel.city]
                                                  textColor:FirstTextColor
                                                       font:16
                                                isSizetoFit:NO
                                              textAlignment:NSTextAlignmentLeft];
    [header addSubview:areaLable];
    
    header.height = areaLable.bottom  + 49;
}
- (void)confimBootomView{
    STButton * addButton = [[STButton alloc] initWithFrame:CGRectMake(0, 0, UIScreenWidth, 49)
                                                     title:@"添加好友"
                                                titleColor:UIColor.whiteColor
                                                 titleFont:16
                                              cornerRadius:0
                                           backgroundColor:TM_ThemeBackGroundColor
                                           backgroundImage:nil
                                                     image:nil];
    addButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
    addButton.bottom = TMUtils.navgationBarBootom;
    [self.view addSubview:addButton];
    __weak typeof(self) weakSelf =  self;
    [addButton setClicAction:^(UIButton *sender) {
        [weakSelf onSelctedBootomButton:sender];
    }];
    
}
#pragma mark --Action Method
- (void)onSelctedBootomButton:(UIButton*)sender{
    if ([sender.currentTitle isEqualToString:@"添加好友"]) {
        DDLogInfo(@"点击了 添加好友");
    }else{
        DDLogInfo(@"点击了 删除好友");
    }
}
@end
